package utilidades.tags;

import java.io.IOException;
import java.util.Date;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;

public class DatumTag extends TagSupport
{
	private	String	value;
	private	String	link;

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	public int doStartTag() throws JspTagException {
		return EVAL_BODY_INCLUDE;
	}

	public int doEndTag() throws JspTagException {
		JspWriter out = pageContext.getOut();

		try {
			out.write("<td class=dato valing=top>");
			if (link!=null)
				out.write("<a href='" + link + "'>");
			if (value!=null)
				out.write(value);
			else
				out.write("&nbsp;");
			if (link!=null)
				out.write("</a>");
			out.write("</td>");
		}
		catch (IOException ex) {
			throw new JspTagException("Error en tag Datum");
		}

		return EVAL_PAGE;
	}
}

